<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Arret Details</f:facet>

        <s:decorate id="voyageIdVoyage" template="layout/display.xhtml">
            <ui:define name="label">Voyage id voyage</ui:define>
            <h:outputText value="#{arretHome.instance.id.voyageIdVoyage}"/>
        </s:decorate>
        <s:decorate id="gareIdgare" template="layout/display.xhtml">
            <ui:define name="label">Gare idgare</ui:define>
            <h:outputText value="#{arretHome.instance.id.gareIdgare}"/>
        </s:decorate>

        <s:decorate id="heureArrivee" template="layout/display.xhtml">
            <ui:define name="label">Heure arrivee</ui:define>
            <h:outputText value="#{arretHome.instance.heureArrivee}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="heureDepart" template="layout/display.xhtml">
            <ui:define name="label">Heure depart</ui:define>
            <h:outputText value="#{arretHome.instance.heureDepart}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/ArretEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty arretFrom ? 'ArretList' : arretFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Voyage</h:panelGroup>
        </f:facet>
    <div class="association" id="voyageParent">

        <h:outputText value="There is no voyage associated with this arret."
                   rendered="#{arretHome.instance.voyage == null}"/>

        <rich:dataTable var="_voyage"
                   value="#{arretHome.instance.voyage}"
                rendered="#{arretHome.instance.voyage != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="voyageTable">
            <h:column>
                <f:facet name="header">Id voyage</f:facet>
                <h:outputText value="#{_voyage.idVoyage}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Train idtrain</f:facet>
                <h:outputText value="#{_voyage.train.idtrain}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Date depart</f:facet>
                <h:outputText value="#{_voyage.dateDepart}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Date arrivee</f:facet>
                <h:outputText value="#{_voyage.dateArrivee}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewvoyage"
                     value="View"
                      view="/Voyage.xhtml">
                    <f:param name="voyageIdVoyage"
                           value="#{_voyage.idVoyage}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Gare</h:panelGroup>
        </f:facet>
    <div class="association" id="gareParent">

        <h:outputText value="There is no gare associated with this arret."
                   rendered="#{arretHome.instance.gare == null}"/>

        <rich:dataTable var="_gare"
                   value="#{arretHome.instance.gare}"
                rendered="#{arretHome.instance.gare != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="gareTable">
            <h:column>
                <f:facet name="header">Idgare</f:facet>
                <h:outputText value="#{_gare.idgare}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Ville</f:facet>
                <h:outputText value="#{_gare.ville}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewgare"
                     value="View"
                      view="/Gare.xhtml">
                    <f:param name="gareIdgare"
                           value="#{_gare.idgare}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
